package com.springcloud.commons.utils;//package com.springcloud.commons.utils;
//
//import com.gaopin.admin.model.vo.ClsTradeOrderRecordVo;
//import org.apache.poi.hssf.usermodel.HSSFCell;
//import org.apache.poi.hssf.usermodel.HSSFRow;
//import org.apache.poi.hssf.usermodel.HSSFSheet;
//import org.apache.poi.hssf.usermodel.HSSFWorkbook;
//
//import javax.servlet.http.HttpServletResponse;
//import java.io.*;
//import java.text.SimpleDateFormat;
//import java.util.List;
//
//public class clsTradeOrderRecordXlsUtils {
//
//
//	/**
//	 * 导出线上RF供应商报表excl
//	 * @param file
//	 * @param picList
//	 * @return
//	 */
////	public static void getSapExport(List<SysPictureVo> list,HttpServletResponse response){
////		HSSFWorkbook wb = new HSSFWorkbook();
////		// 创建HSSFSheet对象
////		HSSFSheet sheet = wb.createSheet("注册用户信息");
////		// 创建行
////		HSSFRow row1 = sheet.createRow(0);
////		// 创建列
////		HSSFCell cell = row1.createCell(0);
////		// 设置单元格的值
//////		cell.setCellValue("供应商报表");
////		// 合并单元格CellRangeAddress构造参数依次表示起始行，截至行，起始列， 截至列
//////		sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
////		// 在sheet里创建第二行
////		HSSFRow row2 = sheet.createRow(0);
////			// 创建单元格并设置单元格内容
////			row2.createCell(0).setCellValue("Partner");
////			row2.createCell(1).setCellValue("Invoice/order Date");  //发票/订单日期
////			row2.createCell(2).setCellValue("Invoice/order Number");//报价单id
////			row2.createCell(3).setCellValue("Client name"); //客户名称
////			row2.createCell(4).setCellValue("Customer Type");//客户类型
////			row2.createCell(5).setCellValue("End User");//最终用户
////			row2.createCell(6).setCellValue("AS");//品牌（）
////			row2.createCell(7).setCellValue("Collection");//品牌（）
////			row2.createCell(8).setCellValue("Original image ID");//原始
////			row2.createCell(9).setCellValue("Image ID");//高品id
////			row2.createCell(10).setCellValue("Photographer");//摄影师
////			row2.createCell(11).setCellValue("Caption if available");//图片信息
////			row2.createCell(12).setCellValue("Reporting Currency");   //人民币
////			row2.createCell(13).setCellValue("Gross Revenue （RMB）"); //价钱
////			row2.createCell(14).setCellValue("Exchange Rate");  //税率
////			row2.createCell(15).setCellValue("Gross Revenue （F/X)");  //美元
////			row2.createCell(16).setCellValue("Royalty (% to Supplier)");//净收入（供应商）
////			row2.createCell(17).setCellValue("Net Revenue (to Supplier)");//净收入（供应商）
////
////
////
////
////		    // 写入实体数据 实际应用中这些数据从数据库得到，
////
////
////		            if(list!=null && !list.isEmpty()){
////		    		int a = 0;
////				    for(SysPictureVo pic : list){
////				    	a++;
////				    	System.out.println(a);
////				    	 //在sheet里创建第三行
////					    HSSFRow row3=sheet.createRow(a);
////					    row3.createCell(0).setCellValue(pic.getSupplierName());
////					    row3.createCell(1).setCellValue(pic.getContractDay());
////					    row3.createCell(2).setCellValue(pic.getSapid());
////					    row3.createCell(3).setCellValue(pic.getCompanyAName());
////					    row3.createCell(4).setCellValue(pic.getCompanyAType());
////					    row3.createCell(5).setCellValue(pic.getFinalUser());
////					    row3.createCell(6).setCellValue(pic.getMakeUser());
////					    row3.createCell(7).setCellValue(pic.getCollectionName());
////					    row3.createCell(8).setCellValue(pic.getOrgiID());
////					    row3.createCell(9).setCellValue(pic.getCorbisID());
////					    row3.createCell(10).setCellValue(pic.getPhotographername());
////					    row3.createCell(11).setCellValue(pic.getTitle());//图片信息
////					    row3.createCell(12).setCellValue("RMB");
////					    row3.createCell(13).setCellValue(pic.getPictureMoney());//图片价格
////					    row3.createCell(14).setCellValue(0.16); //税率
////					    row3.createCell(15).setCellValue("");
////					    row3.createCell(16).setCellValue("");
////					    row3.createCell(17).setCellValue("");
////				   		}
////		            }
////		         // 输出Excel文件
//////		    		OutputStream output;
////		    		try {
////		    			String path = "d:\\aaa\\供应商报表.xls" ;
////
//////		    			//输出Excel文件
////		    			OutputStream output = new FileOutputStream(path);
////		    			wb.write(output);
////
////		    			output.flush();
////		    			output.close();
////		    			File file = new File(path);
////		    			FileInputStream fileIntput = new FileInputStream(file);
////
////		    			response.setContentType("application/vnd.ms-excel");
//////		    			response.setContentType("application/octet-stream");
////		    			response.addHeader("Content-Disposition", "attachment;filename=");
////		    			OutputStream ouputStream = response.getOutputStream();
//////		    			String urlString = "http://weitu-650-water.bj.bcebos.com/233107877533.jpg";
//////		    			URL url = new URL(urlString);
////		    			DataInputStream dataInputStream = new DataInputStream(fileIntput);
////
////		                byte[] buffer = new byte[1024];
////		                int length;
////
////		                while ((length = dataInputStream.read(buffer)) > 0) {
////		                	ouputStream.write(buffer, 0, length);
////		                }
////
////		                dataInputStream.close();
//////		    			wb.write(ouputStream);
////		    			ouputStream.flush();
////		    		    ouputStream.close();
////		    		} catch (IOException e) {
////		    			// TODO Auto-generated catch block
////		    			e.printStackTrace();
////		    		}
////
////
////		    	}
////
////
//
//
//	/**
//	 * 导出线上支付RM报表
//	 */
//
//
//	public static void getCtorExport(List<ClsTradeOrderRecordVo> list,HttpServletResponse response){
//		HSSFWorkbook wb = new HSSFWorkbook();
//		// 创建HSSFSheet对象
//		HSSFSheet sheet = wb.createSheet("线上购买信息");
//		// 创建行
//		HSSFRow row1 = sheet.createRow(0);
//		// 创建列
//		HSSFCell cell = row1.createCell(0);
//		// 设置单元格的值
////		cell.setCellValue("供应商报表");
//		// 合并单元格CellRangeAddress构造参数依次表示起始行，截至行，起始列， 截至列
////		sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
//		// 在sheet里创建第二行
//		HSSFRow row2 = sheet.createRow(0);
//			// 创建单元格并设置单元格内容
//			row2.createCell(0).setCellValue("Partner");
//			row2.createCell(1).setCellValue("Invoice/order Date");  //发票/订单日期createTime
//			row2.createCell(2).setCellValue("Invoice/order Number");//报价单idtradeNo
//			row2.createCell(3).setCellValue("Client name"); //客户名称userId
//			row2.createCell(4).setCellValue("Customer Type");//客户类型
//			row2.createCell(5).setCellValue("End User");//最终用户  projectLeader
//			row2.createCell(6).setCellValue("AS");//线上购买
//			row2.createCell(7).setCellValue("Collection");//品牌（）
//			row2.createCell(8).setCellValue("Original image ID");//原始
//			row2.createCell(9).setCellValue("Image ID");//高品id
//			row2.createCell(10).setCellValue("Use");//许可用途imageUses
//			row2.createCell(11).setCellValue("Photographer");//摄影师
//			row2.createCell(12).setCellValue("Caption if available");//图片信息
//			row2.createCell(13).setCellValue("License Start Date");//许可开始时间 imageTime
////			row2.createCell(14).setCellValue("License End Date");//许可结束时间imageTime
//			row2.createCell(14).setCellValue("Territory of License");//许可区域imageArea
//			row2.createCell(15).setCellValue("End User Industry Segment");//最终用户行业projectName
//			row2.createCell(16).setCellValue("Reporting Currency");   //人民币
//			row2.createCell(17).setCellValue("Gross Revenue （RMB）"); //价钱money
//			row2.createCell(18).setCellValue("Exchange Rate");  //税率
//			row2.createCell(19).setCellValue("Gross Revenue （F/X)");  //美元
//			row2.createCell(20).setCellValue("Royalty (% to Supplier)");//净收入（供应商）
//			row2.createCell(21).setCellValue("Net Revenue (to Supplier)");//净收入（供应商）
//
//
//
//
//		    // 写入实体数据 实际应用中这些数据从数据库得到，
//
//
//		            if(list!=null && !list.isEmpty()){
//		    		int a = 0;
//				    for(ClsTradeOrderRecordVo pic : list){
//				    	a++;
//				    	System.out.println(a);
//				    	 //在sheet里创建第三行
//					    HSSFRow row3=sheet.createRow(a);
//					    row3.createCell(0).setCellValue(pic.getImageProviderName());
//					    SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//					    String starTime=sdf.format(pic.getCreateTime());
//					    row3.createCell(1).setCellValue(starTime);
//					    row3.createCell(2).setCellValue(pic.getTradeNo());
//					    row3.createCell(3).setCellValue(pic.getUserName());
//					    row3.createCell(4).setCellValue("");
//					    row3.createCell(5).setCellValue(pic.getProjectLeader());
//					    row3.createCell(6).setCellValue("线上");
//					    row3.createCell(7).setCellValue(pic.getCollName());
//					    row3.createCell(8).setCellValue(pic.getImageOrgiId());
//					    row3.createCell(9).setCellValue(pic.getCorbisID());
//					    row3.createCell(10).setCellValue(pic.getImageUser());
//					    row3.createCell(11).setCellValue(pic.getImagePhotoId());
//					    row3.createCell(12).setCellValue(pic.getImageTitle());
//
//					   /* if(pic.getAllowableTime() != null){
//					    	String starTime=sdf.format(pic.getAllowableTime());
//						    row3.createCell(13).setCellValue(starTime);
//					    }
//					    if(pic.getEndTime() != null){
//					    	 String endTime=sdf.format(pic.getEndTime());
//							    row3.createCell(14).setCellValue(endTime);
//					    }*/
//					    if(StringUtils.isNotBlank(pic.getImageTime())){
//							row3.createCell(13).setCellValue(pic.getImageTime());
//					    }
//					    if(StringUtils.isNotBlank(pic.getImageArea())){
//					    	row3.createCell(14).setCellValue(pic.getImageArea());
//					    }
//					    row3.createCell(15).setCellValue(pic.getProjectName());
//					    row3.createCell(16).setCellValue("RMB");
//					    row3.createCell(17).setCellValue(pic.getPicMoney());//图片价格
//					    row3.createCell(18).setCellValue(0.16); //税率
//					    row3.createCell(19).setCellValue("");
//					    row3.createCell(20).setCellValue("");
//					    row3.createCell(21).setCellValue("");
//				   		}
//		            }
//		         // 输出Excel文件
////		    		OutputStream output;
//		    		try {
//		    			String path = "d:\\aaa\\供应商报表.xls" ;
//
////		    			//输出Excel文件
//		    			OutputStream output = new FileOutputStream(path);
//		    			wb.write(output);
//
//		    			output.flush();
//		    			output.close();
//		    			File file = new File(path);
//		    			FileInputStream fileIntput = new FileInputStream(file);
//
//		    			response.setContentType("application/vnd.ms-excel");
////		    			response.setContentType("application/octet-stream");
//		    			response.addHeader("Content-Disposition", "attachment;filename=");
//		    			OutputStream ouputStream = response.getOutputStream();
////		    			String urlString = "http://weitu-650-water.bj.bcebos.com/233107877533.jpg";
////		    			URL url = new URL(urlString);
//		    			DataInputStream dataInputStream = new DataInputStream(fileIntput);
//
//		                byte[] buffer = new byte[1024];
//		                int length;
//
//		                while ((length = dataInputStream.read(buffer)) > 0) {
//		                	ouputStream.write(buffer, 0, length);
//		                }
//
//		                dataInputStream.close();
////		    			wb.write(ouputStream);
//		    			ouputStream.flush();
//		    		    ouputStream.close();
//		    		} catch (IOException e) {
//		    			// TODO Auto-generated catch block
//		    			e.printStackTrace();
//		    		}
//
//
//		    	}
//
////		         // 输出Excel文件
//////		    		OutputStream output;
////		    		try {
////
////
//////		    			//输出Excel文件
////		    			OutputStream output = new FileOutputStream(file);
////		    			wb.write(output);
////
////		    			output.flush();
////		    			output.close();
////		    			File files = new File(path);
////		    			FileInputStream fileIntput = new FileInputStream(files);
////
////		    			responses.setContentType("application/vnd.ms-excel");
//////		    			response.setContentType("application/octet-stream");
////		    			response.addHeader("Content-Disposition", "attachment;filename=");
////		    			OutputStream ouputStream = response.getOutputStream();
//////		    			String urlString = "http://weitu-650-water.bj.bcebos.com/233107877533.jpg";
//////		    			URL url = new URL(urlString);
////		    			DataInputStream dataInputStream = new DataInputStream(fileIntput);
////
////		                byte[] buffer = new byte[1024];
////		                int length;
////
////		                while ((length = dataInputStream.read(buffer)) > 0) {
////		                	ouputStream.write(buffer, 0, length);
////		                }
////
////		                dataInputStream.close();
//////		    			wb.write(ouputStream);
////		    			ouputStream.flush();
////		    		    ouputStream.close();
////		    		} catch (IOException e) {
////		    			// TODO Auto-generated catch block
////		    			e.printStackTrace();
////		    		}
////
////
////		    	}
////
//}
